package com.czxy.demo04;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by hp on 2020/1/31.
 */
public class Test16 {
    public static void main(String[] args) {
        String s = getYesterdayTime();
        System.out.println(s);
    }
    public static String getYesterdayTime(){
        Date date = new Date();
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:hh");
        return sf.format(date.getTime()-(1000*60*60*24));
    }
}
